ROOT_PATH = $(shell pwd)
VERSION     = 1.0.0
PROJECT_OUT = $(ROOT_PATH)/out/
PROJECT_BIN = $(ROOT_PATH)/bin/
PROJECT_LIB = $(ROOT_PATH)/lib/

CC   =  gcc
DEBUG   =  -DUSE_DEBUG
CFLAGS  =  -Wall
PROJECT_INCLUDES = $(ROOT_PATH)/include
SUB = $(shell ls src)
.PHONY: all

all:
	@mkdir -p $(PROJECT_OUT) $(PROJECT_BIN) $(PROJECT_LIB)
	@for subdir in $(SUB); do \
#		echo "dir $$subdir"; \
		cd $(ROOT_PATH)/src/$$subdir && $(MAKE);\
	done
.PHONY:clean
clean:
	rm -rf $(PROJECT_OUT) $(PROJECT_BIN) $(PROJECT_LIB)

export ROOT_PATH PROJECT_OUT PROJECT_BIN PROJECT_LIB VERSION CC DEBUG CFLAGS PROJECT_INCLUDES


